//
//  YXScreenCell.swift
//  SortProject
//
//  Created by ALH000355 on 2021/9/8.
//

import UIKit

class YXScreenCell: UICollectionViewCell {
    var classModel : YXscreenClassModel? {
        didSet {
            if let name = classModel?.name {
                titleLabel.text = name
            }
        }
    }
    lazy var titleLabel: UILabel = {
        let titleLabel = UILabel.init()
        titleLabel.textAlignment = .center
        titleLabel.textColor = .gray
        titleLabel.backgroundColor = .white
        titleLabel.font = .systemFont(ofSize: 16)
        return titleLabel
    }()
    lazy var logoImage: UIImageView = {
        let logoImage = UIImageView.init()
        logoImage.backgroundColor = .white
        return logoImage
    }()
        
        
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        uiConfig()
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func uiConfig() {
        self.backgroundColor = .white
        self.contentView.addSubview(titleLabel)
        self.contentView.addSubview(logoImage)
        
        logoImage.frame = CGRect.init(x: collectionWidth - 20, y: 3, width: 20, height: 20)
        logoImage.backgroundColor = .cyan
        titleLabel.frame = CGRect.init(x: 0, y: 3, width: self.frame.size.width - 30, height: 20)
    }
}
